<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="css\form.css">
    <title>Document</title>
</head>
<body>
    <div class="biaodan">
        <a onclick="ckeck()" class="btn">提交</a>
        <a type="rest" class="btn3">重置</a>
        <ul>
            <li>
                <label for="">姓名:</label>
                <input type="text" name="" placeholder="请输入您的姓名" id="xingming">
            </li>
        </ul>
        <ul>
            <li>
                <label for="">手机号：</label>
                <input type="text" name="" placeholder="请输入11位的手机号" id="num">
            </li>
        </ul>
        <ul>
            <li>
                <label for="">请评价：</label>
                <textarea name="" placeholder="不低于三个字" id="world" ></textarea>
            </li>
        </ul>
    
    </div>
    <div class="bg">
        <img src="img\284.jpg" alt="">
    </div>
    <script>
       function ckeck(){
            var a=document.getElementById("xingming")
            var b=document.getElementById("num")
            var c=document.getElementById("world")
            var  rag=/^[\u4e00-\u9fa5]{2,5}$/;
            var  rbg=/^1[34578]\d{9}$/;
            /* 姓名验证 */
            if(a==null||a==""){
					
					alert('请输入正确的姓名格式')
                    return false
					
				}else if(rag.test(a.value)){
					
					/* alert('姓名格式输入正确') */
				}else{
					alert('请输入正确的姓名格式')
                    return false
				}
                /* 手机号验证 */
                if(b==null||b==""){
					
					alert('手机号不能为空')
                    return false
					
				}else if(rbg.test(b.value)){
					
					/* alert('手机号格式输入正确') */
					
				}else{
					alert('请输入正确的手机号格式')
                    return false
				}
                /* 文本域判断 */
                if (c.value.length<3){
                    alert('字数不够，请再多写点')
                    return false
                } else{
                    alert('谢谢您的评价')
                }
                window.location.href="end.html"
        }
    </script>
</body>
</html>